package com.sj.common.dto.article;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * Created with IntelliJ IDEA.
 * User: xiaoqi
 * Date: 2022-03-12
 * Time: 上午 9:56
 * Description: 保存文章的参数
 *
 * @author xiaoqi
 * @since 2022-03-12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ArticleSaveParam implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("文章id 自整张")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("文章类型")
    @NotBlank(message = "文章类型不能为空")
    private String type;

    @ApiModelProperty("文章标题")
    @NotBlank(message = "文章标题不能为空")
    private String title;

    @ApiModelProperty("文章内容")
    private String content;

    @ApiModelProperty("是否仅自己可见？ 1 私密 0 公开")
    private Boolean isSecret;

    @ApiModelProperty("文章首图")
    private String firstUrl;

    @ApiModelProperty("匿名 1 匿名 0 公开")
    private Boolean anonymity;

    @ApiModelProperty("文章标签，用 “,” 拼接")
    @NotBlank(message = "请至少选择一个标签，或者自己创建一个")
    private String tags;
}